HTML Full Course [Day 2] [Hindi]π‘ | Elements, Attributes, Formatting | Mohit Decodes
HTML Tutorial β Part 2: Elements, Attributes & Text Formatting
Welcome back to the HTML Full Course by Mohit Decodes! In this tutorial, weβll dive deeper into essential building blocks of HTML β elements, attributes, headings, paragraphs, and how to style and format your text.
1οΈβ£ HTML Elements
HTML elements are the foundation of every webpage. They define the structure and content.
β Common Elements:
<h1>
to<h6>
β Headings<p>
β Paragraph<div>
β Division or section<span>
β Inline container<a>
β Anchor (links)<img>
β Image
π Example:
2οΈβ£ HTML Attributes
Attributes provide additional information about elements. They are always written inside the opening tag.
β Examples of Attributes:
href
for linkssrc
for imagesalt
for image descriptionstyle
for inline CSS
π Example:
3οΈβ£ HTML Headings
Headings are used to define titles or subtitles on a page. There are 6 levels: from <h1>
(most important) to <h6>
(least important).
π Example:
4οΈβ£ HTML Paragraphs
The <p>
tag defines a paragraph of text. It automatically adds space before and after the content.
π Example:
5οΈβ£ HTML Styles
The style
attribute is used to add CSS directly to an element for quick customization.
π Example:
π Note: Inline styles are useful for small tweaks, but it's better to use internal or external CSS for larger projects.
6οΈβ£ Text Formatting Tags
HTML offers tags to format text visually and semantically.
β Common Formatting Tags:
<b>
β Bold (non-semantic)<strong>
β Bold (semantic)<i>
β Italic (non-semantic)<em>
β Emphasis (semantic)<mark>
β Highlighted text<u>
β Underlined<small>
β Smaller text<del>
β Deleted (strikethrough)<ins>
β Inserted (underlined)
π Example: